<template>
  <div class="adminshow">
    <span style="color:#fff">{{adminname}}</span>
    <el-button type="text" @click="logout" style="margin-left:20px;color:#ff9900">注销</el-button>
  </div>
</template>

<script>
import axios from "axios";
export default {
  props: ["adminname"],
  data() {
    return {};
  },
  methods: {
    logout() {
      axios.get("/admin/logout").then(res => {
        if (res.data) {
          this.$router.push("/login");
        }
      });
    }
  }
};
</script>

<style scoped>
.adminshow {
  height: 59px;
  line-height: 59px;
}
</style>